VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "mswinsck.ocx"
Begin VB.Form frmMainMenu 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Main Menu"
   ClientHeight    =   4200
   ClientLeft      =   7140
   ClientTop       =   4545
   ClientWidth     =   6285
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4200
   ScaleWidth      =   6285
   Begin VB.Timer timerCheckStatus 
      Interval        =   1
      Left            =   120
      Top             =   1560
   End
   Begin VB.CommandButton cmdConnect 
      BackColor       =   &H00FF8080&
      Caption         =   "Connect"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   186
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   120
      Style           =   1  'Graphical
      TabIndex        =   6
      Top             =   3480
      Visible         =   0   'False
      Width           =   1455
   End
   Begin VB.CommandButton btnShowLogin 
      BackColor       =   &H0000FFFF&
      Caption         =   "Login"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   186
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   120
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   120
      Width           =   1455
   End
   Begin MSWinsockLib.Winsock Socket 
      Left            =   600
      Top             =   1560
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   393216
   End
   Begin VB.CommandButton btnExit 
      BackColor       =   &H000000FF&
      Caption         =   "Exit"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   186
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   120
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   1080
      Width           =   1455
   End
   Begin VB.CommandButton btnShowRegister 
      BackColor       =   &H0000FF00&
      Caption         =   "Register"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   186
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   120
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   600
      Width           =   1455
   End
   Begin VB.TextBox txtShowNews 
      Appearance      =   0  'Flat
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   186
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   3735
      Left            =   1680
      Locked          =   -1  'True
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   2
      Top             =   360
      Width           =   4575
   End
   Begin VB.Label lblNews 
      AutoSize        =   -1  'True
      Caption         =   "News:"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   186
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   240
      Left            =   1680
      TabIndex        =   5
      Top             =   120
      Width           =   540
   End
   Begin VB.Label lblStatus 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H00000000&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "Not Connected"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   186
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   255
      Left            =   120
      TabIndex        =   4
      Top             =   3840
      Width           =   1455
   End
End
Attribute VB_Name = "frmMainMenu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub btnExit_Click()
    Call Unload(Me)
End Sub

Private Sub btnShowLogin_Click()
    Me.Hide
    frmLogin.Show
End Sub

Private Sub btnShowRegister_Click()
    Call Me.Hide
    Call frmRegister.Show
End Sub

Private Sub cmdConnect_Click()
If Not IsConnected Then _
    Call ConnectToServer
End Sub

Private Sub Form_Load()

End Sub

Private Sub Socket_DataArrival(ByVal bytesTotal As Long)
    Dim sData As String
    Call Socket.GetData(sData, vbString)
    HandleData (sData)
End Sub


Private Sub timerCheckStatus_Timer()
If IsConnected Then
    lblStatus.Caption = "Connected"
    lblStatus.ForeColor = vbGreen
    cmdConnect.Enabled = False
    cmdConnect.Visible = False
ElseIf IsConnecting Then
    lblStatus.Caption = "Connecting"
    lblStatus.ForeColor = vbYellow
    cmdConnect.Enabled = False
    cmdConnect.Visible = True
ElseIf Not (IsConnected) And Not (IsConnecting) Then
    lblStatus.Caption = "Not Connected"
    lblStatus.ForeColor = vbRed
    cmdConnect.Enabled = True
    cmdConnect.Visible = True
End If
End Sub
